cmake_minimum_required(VERSION 3.10)
project(ModernOpenGLExample)

# Set the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Set include directories
include_directories(${CMAKE_SOURCE_DIR}/include)

# Find OpenGL package
find_package(OpenGL REQUIRED)

# Find GLFW package
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLFW REQUIRED glfw3)

# Set GLFW include directories
include_directories(${GLFW_INCLUDE_DIRS})

# Define common source files
set(COMMON_SOURCES src/glad.c)

# Add executable
add_executable(Transform transform.cpp Shader.cpp src/glad.c)

# Link libraries
target_link_libraries(Transform OpenGL::GL ${GLFW_LIBRARIES} dl)

# Add executable
add_executable(exe1 exe1.cpp Shader.cpp src/glad.c)

# Link libraries
target_link_libraries(exe1 OpenGL::GL ${GLFW_LIBRARIES} dl)

# Add executable
add_executable(exe2 exe2.cpp Shader.cpp src/glad.c)

# Link libraries
target_link_libraries(exe2 OpenGL::GL ${GLFW_LIBRARIES} dl)